package com.example.train.app.service.impl;

import com.example.train.app.service.DepartmentService;
import com.example.train.domain.entity.Department;
import com.example.train.domain.repository.DepartmentRepository;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author: chundong.huang@hand-china.com
 * @Date: 2023/3/25 15:39
 */
@Service
public class DepartmentServiceImpl implements DepartmentService {
    private final DepartmentRepository departmentRepository;

    public DepartmentServiceImpl(DepartmentRepository departmentRepository) {
        this.departmentRepository = departmentRepository;
    }

    @Override
    public List<Department> list(Long id) {
        return departmentRepository.list(id);
    }

    @Override
    public int del(Long id) {
        return departmentRepository.del(id);
    }

    @Override
    public int update(Department department) {
        return departmentRepository.update(department);
    }

    @Override
    public int insert(Department department) {
        return departmentRepository.insert(department);
    }
}
